<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <base href="/">

</head>
<style>
table th{
    color:white ;
    background-color: rgb(93, 213, 200) ;
    width: 170px ;
    height: 50px ;
    font-size: 20px;
}
table td a{
    text-decoration: none ;
}
table th,table td{
    text-align: center ;
}

</style>
<body>
{% extends "motherboard.html"%}

{% block shop %}
<table border="1">
    <tr>
    <th>时间</th>
    <th>款式编码</th>
    <th>总销量</th>
    <th>库存</th>
    <th>操作</th>
    </tr>
    {% for line in page_obj.object_list %}
    <tr>
        <td>{{line.time|date:"Y-m-d"}}</td>
        <td>{{line.number}}</td>
        <td>{{line.sales}}</td>
        <td>{{line.tory}}</td>
    <td>
        <a href="/index1/Remove_shop/?number={{ line.number }}">移出</a>
        <a href="/index1/delete_shop/?number={{ line.number }}">删除</a>
    </td>
    </tr>
    {% endfor %}
</table>

<ul class="pagination">
	<li><a href='?page=1'>首页</a></li>
	{% if page_obj.has_previous %}
            <li><a href="?page={{ page_obj.previous_page_number }}" >上一页</a></li>
            {# 如果上一页没有数据了，那么不让做任何操作 #}
        {% else %}
        {% endif %}

    {% if data.first %}
                    <li><a href="/index1/noshop/?page=1">1</a></li>
                {% endif %}
                {% if data.left %}
                    {% if data.left_s %}
                        <li><a href="#">...</a></li>
                    {% endif %}
                    {% for i in data.left %}
                        <li><a href="/index1/noshop/?page={{ i }}">{{ i }}</a></li>
                    {% endfor %}
                {% endif %}
                <li><a href="#"> {{ page_num }}</a></li>
                {% if data.right %}
                    {% for i in data.right %}
                        <li><a href="/index1/noshop/?page={{ i }}">{{ i }}</a></li>
                    {% endfor %}
                    {% if data.right_s %}
                        <li><a href="#">...</a></li>
                    {% endif %}
                {% endif %}
                {% if data.last %}
                    <li ><a href="/index1/noshop/?page={{ paginator.num_pages }}">{{ paginator.num_pages }}</a>
                    </li>
                {% endif %}

	{# 如果当前页还有下一页，那么让其可以点击进入下一页 #}
        {% if page_obj.has_next %}
            <li><a href="/index1/noshop/?page={{ page_obj.next_page_number }}" >下一页</a></li>
        {% endif %}
	{# 跳转到尾页，让page参数直接等于总页数 #}
        <li><a href='/index1/noshop/?page={{ paginator.num_pages }}'>尾页</a></li>
</ul>
{% endblock %}
</body>
</html>